import { ResPage, Banner, ResultData } from "@/api/interface/index";
import http from "@/api";

/**
 * @name Banner管理模块
 */
// 获取Banner列表
export const getBannerList = (params: Banner.ReqBannerParams) => {
  return http.post<ResPage<Banner.ResBannerList>>(`/banner/query`, params);
};

// 获取Banner详情
export const getBannerDtl = (params: { roleId: string }) => {
  return http.post<ResultData>(`/banner/detail`, params);
};

// 新增Banner
export const addBanner = (params: {}) => {
  return http.post(`/banner/add`, params);
};
// 编辑Banner
export const editBanner = (params: { bannerId: string }) => {
  return http.post(`/banner/modify`, params);
};

// 删除Banner
export const deleteBanner = (params: { dataList: { bannerId: number }[] }) => {
  return http.post(`/banner/remove`, params);
};

// 切换Banner状态
export const changeBannerStatus = (params: { status: number; dataList: { bannerId: number }[] }) => {
  return http.post(`/banner/modifyStatus`, params);
};
